package com.atguigu.gulimall.order.feign;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.order.vo.OrderLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("gulimall-ware")
public interface WmsFeignService {

    // 查询库存
    @RequestMapping("/ware/waresku/query/stock")
    R queryStock(@RequestBody List<Long> skuIds);

    // 根据addressId获取邮费
    @GetMapping("/ware/wareinfo/fare")
    public R getFare(@RequestParam("addressId") Long addressId);

    // 锁库存
    @PostMapping("/ware/waresku/lock/stock")
    public R lockOrderStock(@RequestBody OrderLockVo orderLockVo);

}
